<%--
  Created by IntelliJ IDEA.
  User: 进击的龟仙人
  Date: 2021/4/26
  Time: 9:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <%
        String path=request.getContextPath();
        String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <base href="<%=basePath%>">
    <link rel="stylesheet" href="layui-v2.6.5/layui/css/layui.css">
    <script src="layui-v2.6.5/layui/layui.js"></script>
    <script src="js/jquery-3.5.1.js" type="text/javascript"></script>
</head>
<style type="text/css">
    #login {
        height: 300px;
        background-color: white;
        margin: 100px 400px;
        border: black 1px solid;
    }

</style>
<body>
<script type="text/javascript">
    //加载form模块
    layui.use(form, function () {
        var form = layui.form;
    })
</script>
<div class="layui-container" style="height: 720px;background-color: #00F7DE;background-image: url(image/clothes3.png)">
    <div style="text-align: center;color: #1E9FFF;font-size: 50px;padding: 30px">
        <img src="image/clothes4.png" alt="" height="50px">
        <b>欢迎登录</b>
    </div>
    <div class="layui-row">
        <div class="layui-col-md4" id="login">
            <div class="layui-col-md12" style="background-color: white;height: 32px;text-align: center;background-color: #FFFF00">
                <img src="image/hint.png" alt="">
                <span style="font-family: 宋体"><%=request.getAttribute("msg")==null?"请输入用户名和密码":request.getAttribute("msg")%></span>
            </div>
            <br>
            <form action="userServlet" class="layui-form" method="post">
                <%--                隐藏表单--%>
                <input type="hidden" name="action" value="Login">
                <%--          账号框--%>
                <div class="layui-form-item" style="margin-top: 30px">
                    <label class="layui-form-label">用户名:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="username" class="layui-input" placeholder="请输入用户名" lay-verify="required"
                               value="<%=request.getAttribute("username")==null?"":request.getAttribute("username")%>"/>
                    </div>
                </div>
                <%--  密码框--%>
                <div class="layui-form-item">
                    <label class="layui-form-label">密码:</label>
                    <div class="layui-input-inline">
                        <input type="password" name="password" placeholder="请输入密码" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
<%--                    身份框--%>
                <div class="layui-form-item">
                    <label class="layui-form-label">身份:</label>
                    <div class="layui-input-inline">
                        <select name="identity" lay-verify="required">
                            <option value="">请选择您的身份</option>
                            <option value="admin">管理员</option>
                            <option value="user">用户</option>
                        </select>
                    </div>
                </div>
                <%--  登录注册按钮--%>
                <div>
                    <button type="submit" class="layui-btn layui-btn-radius layui-btn-normal" style="margin: 0px 0px 30px 50px">登录
                    </button>
                    <a href="register.jsp">
                        <button type="button" class="layui-btn layui-btn-radius layui-btn-normal" style="margin: 0px 0px 30px 110px">注册
                    </button>
                    </a>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
